package code;

public class Rectangle {
	private float length=1.0f;
	private float width=1.0f;
	public Rectangle(){}
	public Rectangle(float length,float width){
		if(length>0&&width>0){
		this.length=length;
		this.width=width;
		}
	}
	public float getLength(){
		return this.length;
	}
	public void setLength(float length){
		if(length>0){
			 this.length=length;
		}
		this.length=length;
	}
	public float getWidth(){
		return this.width;
	}
	public void setWidth(float width){
		if(width>0){
			this.width=width;
		}
	
	}
	public double getArea(){
		return this.length*this.width;
	}
	public double getPerimeter(){
		return this.length*this.width;
	}
	public String toString(){
		String str2="Rectangle[length="+this.length+",width="+this.width+"]";
		return str2;
	}
}
